package com.msi.gui;

public class Settings {

	private static Settings instance = null;
	
	public static enum AlgType{
		LF(0),
		SF(1);
		
		private int index;
		
		AlgType(int i){
			index = i;
		}
		
		public int getIndex(){
			return index;
		}
		
		static public AlgType getByIndex(int i){
			for(AlgType a : values()) {
				if(a.getIndex() == i)
					return a;
			}
			return null;
		}
                
                static public AlgType getByName(String s){
                    for(AlgType a : values()) {
				if(a.toString().equals(s))
					return a;
			}
			return null;
                }
	}
	
	private int minDiff = 2;
	private AlgType algType = AlgType.LF;
	//generowanie graf�w
	private float filling = (float) 0.5;
	private int vertexCount = 20;
	
	private String algName;
	private int algIndex = 0;
        
        private AlgType algOpen = null;
        private int diffOpen = 2;
		private double minDensity;
		private double maxDensity;
		private Integer minVertices;
		private Integer maxVertices;
		private Integer iterations;
	
	private Settings(){
		
	}
	
	public static Settings getInstance(){
		if(instance == null){
			instance = new Settings();
		}
		return instance;
	}

	public int getMinDiff() {
		return minDiff;
	}

	public void setMinDiff(int minDiff) {
		this.minDiff = minDiff;
	}

	public float getFilling() {
		return filling;
	}

	public void setFilling(float filling) {
		this.filling = filling;
	}

	public int getVertexCount() {
		return vertexCount;
	}

	public void setVertexCount(int vertexCount) {
		this.vertexCount = vertexCount;
	}

	public String getAlgName() {
		return algName;
	}

	public void setAlgName(String algName) {
		this.algName = algName;
	}

	public int getAlgIndex() {
		return algIndex;
	}

	public void setAlgIndex(int algIndex) {
		this.algIndex = algIndex;
	}

	public void setAlg(int index) {
		algType = AlgType.getByIndex(index);
	}
	
	public AlgType getAlgType(){
		return algType;
	}

    public AlgType getAlgOpen() {
        return algOpen;
    }

    public void setAlgOpen(AlgType algOpen) {
        this.algOpen = algOpen;
    }

    public int getDiffOpen() {
        return diffOpen;
    }

    public void setDiffOpen(int diffOpen) {
        this.diffOpen = diffOpen;
    }

	public void setMinDensity(double minDensity) {
		this.minDensity = minDensity;
	}

	public void setMaxDensity(double maxDensity) {
		this.maxDensity = maxDensity;
	}

	public void setMinVertices(Integer minVertices) {
		this.minVertices = minVertices;
	}

	public void setMaxVertices(Integer maxVertices) {
		this.maxVertices = maxVertices;
	}

	public void setIterations(Integer iterations) {
		this.iterations = iterations;
	}

	public double getMinDensity() {
		return minDensity;
	}

	public double getMaxDensity() {
		return maxDensity;
	}

	public Integer getMinVertices() {
		return minVertices;
	}

	public Integer getMaxVertices() {
		return maxVertices;
	}

	public Integer getIterations() {
		return iterations;
	}

        

	
	
	
}
